Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use session-scoped inventory by default #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

synkd
Copy link
Collaborator

@synkd synkd commented Nov 22, 2024

Currently, Manifester syncs its inventory multiple times while generating a manifest to ensure that the inventory data matches with the corresponding data in RHSM. For some use cases, though, this behavior is not desirable. Notably, in a CI scenario in which multiple workers share the same username_prefix setting, syncing the inventory with RHSM prevents those workers from running manifester delete --all at the end of each pipeline, as this could delete allocations that are still being used by other workers.

This PR addresses this issue by converting the default inventory behavior to not sync from RHSM unless a sync is explicitly invoked.

Currently, Manifester syncs its inventory multiple times while
generating a manifest to ensure that the inventory data matches with the
corresponding data in RHSM. For some use cases, though, this behavior is
not desirable. Notably, in a CI scenario in which multiple workers share
the same `username_prefix` setting, syncing the inventory with RHSM
prevents those workers from running `manifester delete --all` at the end
of each pipeline, as this could delete allocations that are still being
used by other workers.

This PR addresses this issue by converting the default inventory
behavior to not sync from RHSM unless a sync is explicitly invoked.
@synkd synkd added enhancement New feature or request DRAFT Work in progress labels Nov 22, 2024
@synkd synkd self-assigned this Nov 22, 2024
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 suggestion.

_dump_inventory_file(inventory_path, inventory_data)
elif remove:
inv = load_inventory_file(inventory_path)
_dump_inventory_file(inventory_path, [alloc for alloc in inv if uuid not in alloc["uuid"]])
Copy link
Preview

Copilot AI Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition 'uuid not in alloc["uuid"]' should be 'uuid != alloc["uuid"]' to correctly filter out the allocation with the matching UUID.

Suggested change
_dump_inventory_file(inventory_path, [alloc for alloc in inv if uuid not in alloc["uuid"]])
_dump_inventory_file(inventory_path, [alloc for alloc in inv if uuid != alloc["uuid"]])

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@synkd synkd force-pushed the implement_session-scoped_inventory branch from 4e67de9 to 89488f9 Compare December 2, 2024 21:06
@synkd synkd removed the DRAFT Work in progress label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants